#ifndef IEDITOR_H
#define IEDITOR_H

#include <QWidget>
#include "Include/IPluginBase.h"

class QsciLexer;
class ITheme;

enum Severity{
    None = 0,
    Convection = 1,
    Warning = 2,
    Error = 4
};

namespace Plugins
{

class IEditor: public IPluginBase
{
public:
    virtual ~IEditor(){}
    virtual QWidget * widget() = 0;
    virtual QsciLexer * getLexer() = 0;
    virtual void setLexerByName(const QString& lexName) = 0;
    virtual bool save() = 0;
    virtual bool load(const QString & path) = 0;
    virtual void setText(const QString& text) = 0;
    virtual void setTheme(ITheme * theme = NULL, QFont * fnt = NULL) = 0;

    virtual void activate() = 0;
    virtual QString selectedText() = 0;
    virtual void find(const QString& find, bool forward) = 0;
    virtual void replace(const QString& find, const QString& replace, bool findNext, bool forward) = 0;
    virtual void replaceAll(const QString& find, const QString& replace) = 0;
    virtual bool isModified() = 0;
    virtual void setStatusBarVisible(bool show = true) = 0;
public slots:
    virtual void undo() = 0;
    virtual void redo() = 0;
    virtual void copy() = 0;
    virtual void cut() = 0;
    virtual void paste() = 0;
    virtual void del() = 0;
    virtual void selectAll() = 0;
    virtual void uppercase() = 0;
    virtual void lowercase() = 0;
    virtual void capitalize() = 0;
    virtual bool reset() = 0;
    virtual void jumpLine(int) = 0;
    virtual void jumpOffset(int) = 0;
};

}
Q_DECLARE_INTERFACE(Plugins::IEditor, "Plugins.IEditor/1.0")

#endif
